<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <!-- 引包 -->
    <script src="../js/vue.js"></script>
    <style>
        * {
            margin: 0;
            padding: 0;
        }

        .cur {
            margin: 150px 0px;
            width: 400px;
            height: 200px;
            background: yellowgreen;
            animation: donghua 2s linear 0s infinite;
        }

        /* 定义动画 */
        @keyframes donghua {
            from {
                transform: rotate(0deg);
            }

            to {
                transform: rotate(360deg);
            }
        }
    </style>
</head>

<body>
    <div id="app">
        <button v-on:click="handle">通过v-show进行元素的显示与隐藏</button>
        <div class="cur" v-show="show"></div>
    </div>
</body>

</html>
<script>
    //关联VM
    const VM = new Vue({
        el: '#app',
        data: {
            show: true
        },
        methods: {
            //按钮的点击回调函数
            handle() {
             
              this.show = !this.show;
            }
        }
    });

      









</script>